LOCAL_PATH := $(call my-dir)/..

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib1
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_androidcamera.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib2
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_calib3d.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib3
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_contrib.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib4
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib5
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_features2d.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib6
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_flann.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib7
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_gpu.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib8
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_highgui.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib9
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_imgproc.a
include $(PREBUILT_STATIC_LIBRARY)

#include $(CLEAR_VARS)
#LOCAL_MODULE := opencv_lib10
#LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_info.so
#include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib11
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_legacy.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib12
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_ml.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib13
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_nonfree.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib14
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_objdetect.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib15
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_ocl.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib16
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_photo.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib17
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_stitching.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib18
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_superres.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib19
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_ts.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib20
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_video.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_lib21
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/libs/arm64-v8a/libopencv_videostab.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := thirdparty1
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/3rdparty/libs/arm64-v8a/liblibtiff.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := thirdparty2
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/3rdparty/libs/arm64-v8a/libIlmImf.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := thirdparty3
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/3rdparty/libs/arm64-v8a/liblibjasper.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := thirdparty4
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/3rdparty/libs/arm64-v8a/liblibjpeg.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := thirdparty5
LOCAL_SRC_FILES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/3rdparty/libs/arm64-v8a/liblibpng.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := thirdparty6
LOCAL_SRC_FILES := /home/luyao/git/cnn/obj/local/arm64-v8a/libface_detect_cnn.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib1
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libCB.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib2
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libgsl.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib3
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libc++.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib4
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libutils.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib5
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libui.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib6
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libsync.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib7
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libhardware.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib8
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libbacktrace.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib9
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libbase.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib10
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libunwind.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib11
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libc.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib12
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libcutils.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencl_lib
LOCAL_SRC_FILES := /home/luyao/git/face_demo/jni/libOpenCL.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := QML
LOCAL_SRC_FILES := /home/luyao/download/Snapdragon/qml-1.0.0/opt/Qualcomm/QML/1.0.0/arm64/lp64/lib/libQML-1.0.0.so
LOCAL_EXPORT_C_INCLUDES := /home/luyao/download/Snapdragon/qml-1.0.0/opt/Qualcomm/QML/1.0.0/arm64/lp64/include
include $(PREBUILT_SHARED_LIBRARY)

common_static_libraries := opencv_lib2 opencv_lib3 opencv_lib4 opencv_lib5 \
                        opencv_lib6 opencv_lib7 opencv_lib8 opencv_lib9 \
                        opencv_lib11 opencv_lib12 opencv_lib13 opencv_lib14 opencv_lib15 \
                        opencv_lib16 opencv_lib17 opencv_lib18 opencv_lib19 opencv_lib20 opencv_lib21  opencv_lib1 \
                        thirdparty1 thirdparty2 thirdparty3 thirdparty4 thirdparty5 thirdparty6

common_shared_libraries := opencl_lib opencl_lib3 opencl_lib4 opencl_lib5 opencl_lib6 opencl_lib7 opencl_lib8 \
                           opencl_lib9 opencl_lib10 opencl_lib11 opencl_lib12 \
                           opencl_lib1 opencl_lib2 QML

include $(CLEAR_VARS)
LOCAL_MODULE    := android_recognition
LOCAL_SRC_FILES := test_android.cpp cnn_function.cpp jsmn.cpp util.cpp
LOCAL_C_INCLUDES := /home/luyao/git/install_package/opencv-2.4.13.6/build/install/sdk/native/jni/include
LOCAL_C_INCLUDES += ../
LOCAL_C_INCLUDES += /home/luyao/download/opencv_arm/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/include
LOCAL_C_INCLUDES += /home/luyao/download/opencv_arm/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include
# LOCAL_CFLAGS := -Ofast -std=c11
LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)

LOCAL_CPP_FEATURES := rtti
LOCAL_CPP_FEATURES += exceptions
#LOCAL_CPPFLAGS := -std=c++11 -pthread -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DPOSIX -Wall -Wno-literal-suffix
LOCAL_CPPFLAGS := -std=gnu++11 -Ofast -DNO_POINT_GREY
LOCAL_LDLIBS += -llog -lz

include $(BUILD_EXECUTABLE)

$(call import-module,android/native_app_glue)
$(call import-module,cxx-stl/gnu-libstdc++)
